﻿using System;

namespace CML.Intercamber.Business.Model
{
    public class NewsDetail
    {
        public long IdNews { get; set; }

        public string LblUserCreation { get; set; }

        public DateTime DateCreation { get; set; }

        public string DateCreationStr
        {
            get
            {
                return DateCreation.ToString("dd/MM/yyyy HH:mm:ss");
            }
        }

        public bool Enabled { get; set; }

        public long? IdEstablishment { get; set; }

        public string Message { get; set; }

        public string Title { get; set; }

        public bool Editable { get; set; }

        public string IdLanguage { get; set; }

        public bool CanChange(Users u)
        {
            if (u.IsAdmin)
                return true;
            if (u.IsTeacher)
            {
                if (u.IdEstablishment == IdEstablishment)
                    return true;
            }
            return false;
        }

    }
}
